package com.xjk.cloud.controller;

import com.xjk.cloud.model.User;
import com.xjk.cloud.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/{id}")
    public User findById(@PathVariable long id) {
        return  userService.findById(id);
    }
    //zuul网关测试
    @GetMapping("/api-user/{id}")
    public User findByIdApi(@PathVariable long id) {
        return  userService.findById(id);
    }
}
